#include<time.h>
#include<stdio.h>
enum State {R,C};

typedef struct PCB{
    char name;
    int startTime;
    int runTime;
    enum State processState;
    struct PCB* next;
}PCB;
//  struct PCB PCB;

PCB* create_data(){
    PCB* start = malloc(sizeof(PCB));
    PCB* res = start;
    PCB* pre;
    unsigned int seed = 10;
    srand(seed);
    for(int i=0;i<10;i++){
        start->name = 'a' + i;
        start->startTime = i;
        start->runTime = rand()%10+1;
        start->processState = R;
        start->next = malloc(sizeof(PCB));
        pre = start;
        start = start->next;
    }
    // free(pre->next);
    pre->next = NULL;
    return res;
}

int main(){
    PCB* start = create_data();
    while(start){
        printf("the name is: %c, the runTime is: %d\n",start->name,start->runTime);
        start = start->next;
    }
}